<style>
    .footer.footer-home {display: none;}
    .header-categoryson{margin-top: 0;}
    .content-bot{margin-top: 0;}
</style>
<div class="header">
    <a href="index.php" class="return iconfont icon-shangyiye"></a>
    <div class="header-title"><?php echo $output['cate_name']; ?></div>
</div>
<div class="header header-categoryson">
    <form action="index.php">
        <input type="hidden" name="act" value="index">
        <input type="hidden" name="op" value="search">
        <i class="iconfont icon-sousuo"></i>
        <input type="text" name="title" placeholder="输入城市或者景点" />
    </form>
</div>
<div class="content content-bot">
   <!-- <ul class="categoryson-title">
        <?php /*foreach ($output['cates'] as $cate): */?>
            <?php /*if ($cate['tc_id'] == $output['id']): */?>
                <li class="active"><?php /*echo $cate['tc_name']; */?></li>
            <?php /*else: */?>
                <a href="index.php?act=cate&op=sub&pid=<?php /*echo $cate['tc_pid']; */?>&id=<?php /*echo $cate['tc_id']; */?>"><li><?php /*echo $cate['tc_name']; */?></li></a>
            <?php /*endif; */?>
        <?php /*endforeach; */?>
    </ul>-->
    <div class="recommend-list commodity commodity-block">
        <ul class="commodity-wraw">
            <?php if (!empty($output['tickets'])): ?>
            <?php foreach ($output['tickets'] as $ticket): ?>
            <li>
                <div class="commodity-img">
                    <a href="index.php?act=ticket&op=detail&tid=<?php echo $ticket['tk_id']; ?>"><img src="<?php echo $ticket['tk_thumb']; ?>" /></a>
                </div>
                <div class="commodity-con">
                    <div class="commodity-title"><a href="index.php?act=ticket&op=detail&tid=<?php echo $ticket['tk_id']; ?>"><?php echo $ticket['tk_title']; ?></a></div>
                    <?php if (in_array($ticket['tk_cate2'], array(7,8,10))): ?>
                        <div class="commodity-inf"><p><?php echo $ticket['tk_subtitle']; ?></p></div>
                    <?php else: ?>
                        <div class="commodity-price"><b><samp>¥</samp><?php echo $ticket['tk_show_price']; ?></b><del>¥<?php echo $ticket['tk_market_price']; ?></del></div>
                    <?php endif; ?>
                </div>
                <div class="clear"></div>
            </li>
            <?php endforeach; ?>
            <?php else: ?>
            <div class="empty">暂时没有您要的内容</div>
            <?php endif; ?>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="load hide">正在加载...</div>
</div>

<script>
    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = false;
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            $('.load').text('没有更多内容了').show();
            return;
        }
        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $(".commodity-wraw").append(data);
                $('.load').hide();
            }
        });
    }
    $(window).scroll(function () {
        $('.load').show();
        is_scroll = true;
        //已经滚动到上面的页面高度
        var scrollTop = $(this).scrollTop();
        //页面高度
        var scrollHeight = $(document).height();
        //浏览器窗口高度
        var windowHeight = $(this).height();
        //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
        if (scrollTop + windowHeight == scrollHeight) {
            loadpage();
        }
    });
</script>